
#include "tinyplugin.h"
#include "tp_log.h"
#include "tp_platform.h"
#include "tp_bitmap_factory.h"
#include "tp_main_loop.h"
#include "tp_backend.h"
#include "tp_wnd_manager.h"

int tp_init(int argc, char* argv[])
{
    tp_log_init(TP_LOG_I);

	tp_platform_init();

    tp_bitmap_factory_init();

	tp_main_loop_init();

	tp_backend_init();

    tp_wnd_manager_init();

	return TP_RET_OK;
}

static void tp_uninit(void)
{
    tp_bitmap_factory_uninit();
    
    tp_main_loop_uninit();

    tp_platform_uninit();

	return;
}

void tp_quit(void)
{
	tp_main_loop_quit();

	return;
}

int tp_run(void)
{
	tp_main_loop_run();

	tp_uninit();

	return TP_RET_OK;
}
